#ifndef GLOBAL_H
#define GLOBAL_H

#include "math.h"
#include <QPointF>
#include <QString>


struct Muta {


    enum MutaType{
        Line = 100,
        Event = 101,
        Edit = 102,
        ControlPoint = 103,
        Cursor = 104,
        Repeat = 105,
        Curve = 106,
        LFO = 107,
        Graph = 108,
        AutoTendril = 109,
        Blend = 110,
        StrangeAttractor = 111,
        UserCursor = 112
    };

    static const int BEAT_PIXELS = 32;

    //OSCthulhu
    static bool ONLINE;
    static QString userName;
    static int objectCount;
    static QString getObjectID();

    static const int OUTPUT_BUFFER_SIZE = 1024;

    static double quantize(double d, double multiple)
    {
        return round(d / multiple) * multiple;
    }

    static QPointF quantizePoint(QPointF point,double xQuant, double yQuant)
    {
        double x = quantize(point.x(),xQuant);
        double y = quantize(point.y(),yQuant);
        QPointF quantPoint(x,y);
        return quantPoint;
    }

    static double quantizeD(double d, double multiple)
    {
        return ((int)(d / multiple)) * multiple;
    }

    static QPointF quantizePointD(QPointF point,double xQuant, double yQuant)
    {
        double x = quantizeD(point.x(),xQuant);
        double y = quantizeD(point.y(),yQuant);
        QPointF quantPoint(x,y);
        return quantPoint;
    }
};

#endif // GLOBAL_H
